package zoo.order.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import zoo.order.domain.OrderCommand;

public class OrderDaoImpl extends SqlSessionDaoSupport implements OrderDao{

	@Override
	public void insertOrder(OrderCommand command) {
		getSqlSession().insert("insertOrder",command);
	}

	@Override
	public List<OrderCommand> orderList(Map<String, Object> map) {
		List<OrderCommand> list = getSqlSession().selectList("orderList", map);
		return list;
	}

	@Override
	public int getOrderCount(Map<String, Object> map) {
		return (Integer)getSqlSession().selectOne("selectOrderCount", map);
	}

	@Override
	public OrderCommand selectOrder(Integer or_num) {
		OrderCommand order = getSqlSession().selectOne("orderDetail",or_num);
		return order;
	}

}
